<?
/**
 * @category   e-commerce
 * @package    Storage
 * @author     Alberto Pardo Saleme <apardo@adverit.com>
 * @copyright  2005 - AdVerit S.A. <www.adverit.com>
 * @version    Release: 1.0
 * @update     03/01/2006 03:09p.m.
 */


require_once(dirname(__FILE__) ."/StorageSession.php");


class StorageSession extends Storage
{
	private $sessionManager;

	// constructor
	function __construct($name)
	{
		parent::__construct($name);
		$this->sessionManager = new SessionManager();
	}

	function store($items)
	{
		$this->sessionManager->set($this->_name, serialize($items));
	}

	function retreive()
	{
		$storedData = unserialize($this->sessionManager->get($this->_name));
		return $storedData? $storedData : array();
	}

	function destroy()
	{
		$this->sessionManager->delete($this->_name);
	}
}

?>
